var tzPay = {
	pay:function(opts){
		var params = this.params[opts.paytype](opts);
		$.ajax({
			type:"post",
			url:"http://localhsot:8080/tzpay/"+opts.paytype+"/pay.html",
			data:params,
			success:function(data){
				if(opts.paytype=="ali"){
					$("#payhtml").html(data);
				}else if(opts.paytype=="weixin"){
					var money = opts.money;
					window.location = "http://localhost:8080/tzpay/weixin/paying.html?money="+money;
//					$("#tm-pay").html("<img src='"+tm-pay+"' height='200' width=200'/>");
				}
			}
		});
	},
	
	params:{
		ali:function(opts){
			return {
				pno:opts.pno,
				subject:opts.subject,
				money:opts.money,
				detailUrl:opts.detailUrl
			};
		},
		weixin:function(opts){
			return {
				pno:opts.pno,
				subject:opts.subject,
				money:opts.money,
				detailUrl:opts.detailUrl
			};
		},
		wangyin:function(){
			//....
		}
			
	}
};